package snail.model;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author Johan
 */
public class Bid implements Serializable, Comparable<Bid> {
    private int bidId;
    private int userId;
    private int articleId;
    private int bid;
    private Date bidDate;
    private User user;
    private Article article;

    public Article getArticle() {
        return article;
    }

    public void setArticle(Article article) {
        this.article = article;
    }

    public int getArticleId() {
        return articleId;
    }

    public void setArticleId(int articleId) {
        this.articleId = articleId;
    }

    public int getBid() {
        return bid;
    }

    public void setBid(int bid) {
        this.bid = bid;
    }

    public Date getBidDate() {
        return bidDate;
    }

    public void setBidDate(Date bidDate) {
        this.bidDate = bidDate;
    }

    public int getBidId() {
        return bidId;
    }

    public void setBidId(int bidId) {
        this.bidId = bidId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int compareTo(Bid o) {
        // WARNING! very very low-level
       return o.bid < this.bid ? 1 : (o.bid == this.bid ? 0 : -1);
    }

}
